package com.ang.utils;

import java.nio.charset.StandardCharsets;
import java.util.Base64;

/**
 * @author ssang
 * @date 2022-09-27 16:09
 */
public class Base64Util {
    public static String encrypt(String plain) {
        return Base64.getEncoder().encodeToString(plain.getBytes(StandardCharsets.UTF_8));
    }

    public static String decrypt(String cipher) {
        return new String(Base64.getDecoder().decode(cipher), StandardCharsets.UTF_8);
    }
}
